<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>爱情名言</title>
    <link rel="stylesheet" href="../css/all.min.css">
    <script src="../js/html2canvas.min.js"></script>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: -apple-system, BlinkMacSystemFont, 'MyFont', Roboto, Helvetica, Arial, sans-serif;
        }
        @font-face {
            font-family: 'MyFont';
            src: url('../font/MyFont-Regular.ttf') format('truetype');
            font-weight: normal;
            font-style: normal;
            font-display: swap;
        }
        @media (max-width: 600px) {
            h1 {
                font-size: 24px !important;
            }
            div[style*="padding: 35px 30px"] {
                padding: 25px 20px !important;
                border-radius: 12px !important;
            }
            p[style*="font-size: 17px"] {
                font-size: 16px !important;
            }
            /* 移动端隐藏右侧按钮组 */
            .tool-btn-group {
                display: none !important;
            }
        }
        /* 工具按钮组样式 */
        .tool-btn-group {
            position: fixed;
            right: 30px;
            top: 50%;
            transform: translateY(-50%);
            z-index: 9999;
            display: flex;
            flex-direction: column;
            gap: 15px;
        }
        .tool-btn {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            border: none;
            background: linear-gradient(to right, #e66465, #9198e5);
            color: white;
            font-size: 14px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 4px 10px rgba(0,0,0,0.15);
            transition: all 0.3s ease;
        }
        .tool-btn:hover {
            transform: scale(1.1);
            box-shadow: 0 6px 15px rgba(0,0,0,0.2);
        }
        .quote-card {
            background-color: #fff;
            border-radius: 12px;
            box-shadow: 0 4px 15px rgba(0,0,0,0.05);
            padding: 25px;
            margin-bottom: 25px;
            border-left: 4px solid #e66465;
            transition: transform 0.3s ease;
        }
        .quote-card:hover {
            transform: translateY(-5px);
        }
        .quote-text {
            font-size: 17px;
            color: #444;
            line-height: 1.8;
            margin-bottom: 15px;
        }
        .quote-author {
            font-size: 14px;
            color: #888;
            text-align: right;
            font-style: italic;
        }
        .section-title {
            font-size: 22px;
            color: #222;
            margin: 40px 0 25px 0;
            padding-bottom: 10px;
            border-bottom: 2px solid #f0f0f0;
        }
    </style>
</head>
<body style="font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; background: linear-gradient(135deg, #f5f7fa 0%, #fafafa 100%); color: #333; line-height: 1.8; padding-bottom: 50px; min-height: 100vh;">
    <div class="tool-btn-group">
        <button class="tool-btn" id="font-enlarge"><i class="fas fa-search-plus"></i></button>
        <button class="tool-btn" id="font-reduce"><i class="fas fa-search-minus"></i></button>
        <button class="tool-btn" id="export-image"><i class="fas fa-file-export"></i></button>
    </div>

    <div style="max-width: 680px; margin: 0 auto; padding: 0 16px;" id="content-container" contenteditable="true">
        <div style="background-color: #fff; border-radius: 16px; box-shadow: 0 8px 30px rgba(0,0,0,0.08); margin-top: 30px; padding: 35px 30px; position: relative; overflow: hidden;">
            <div style="content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: linear-gradient(to right, #e66465, #9198e5);"></div>
            
            <div style="font-size: 28px; color: #222; line-height: 1.4; margin-bottom: 25px; padding-bottom: 20px; border-bottom: 1px solid #f0f0f0; position: relative; text-align: center;">
                美入心间的爱情名言与句子
                <div style="content: ''; position: absolute; bottom: -1px; left: 50%; transform: translateX(-50%); width: 120px; height: 3px; background: linear-gradient(to right, #e66465, #9198e5); border-radius: 3px;"></div>
            </div>
            
            <div style="text-align: center; margin: 30px 0; padding: 20px; background: linear-gradient(135deg, #fef5f5 0%, #f9f9ff 100%); border-radius: 12px;">
                <p style="font-size: 20px; color: #e66465; line-height: 1.6;">"爱情是理解和体贴的别名。"</p>
                <p style="font-size: 16px; color: #888; margin-top: 10px;">—— 泰戈尔</p>
            </div>

            <div class="section-title">世界名人爱情语录</div>

            <div class="quote-card">
                <p class="quote-text">爱就是充实了的生命，正如盛满了酒的酒杯。</p>
                <p class="quote-author">—— 泰戈尔</p>
            </div>

            <div class="quote-card">
                <p class="quote-text">爱情不是用眼睛，而是用心灵看着的。</p>
                <p class="quote-author">—— 莎士比亚</p>
            </div>

            <div class="quote-card">
                <p class="quote-text">真正的爱情是不能用言语表达的，行为才是忠心的最好说明。</p>
                <p class="quote-author">—— 莎士比亚</p>
            </div>

            <div class="quote-card">
                <p class="quote-text">爱情是生命的火花，没有它，一切都将变成黑夜。</p>
                <p class="quote-author">—— 罗曼·罗兰</p>
            </div>

            <div class="quote-card">
                <p class="quote-text">我的心是旷野的鸟，在你的眼睛里找到了它的天空。</p>
                <p class="quote-author">—— 泰戈尔</p>
            </div>

            <div class="quote-card">
                <p class="quote-text">爱，是人与生俱来的一种本能，根本不必去刻意寻找。</p>
                <p class="quote-author">—— 弗洛姆</p>
            </div>

            <div class="quote-card">
                <p class="quote-text">爱情使人心的憧憬升华到至善之境。</p>
                <p class="quote-author">—— 但丁</p>
            </div>

            <div class="quote-card">
                <p class="quote-text">爱情是两个灵魂在一个身体里。</p>
                <p class="quote-author">—— 亚里士多德</p>
            </div>

            <div class="quote-card">
                <p class="quote-text">爱的力量是和平，从不顾理性、成规和荣辱，它能使一切恐惧、震惊和痛苦在身受时化作甜蜜。</p>
                <p class="quote-author">—— 莎士比亚</p>
            </div>

            <div class="quote-card">
                <p class="quote-text">爱情是一个平台，上面聚集着形形色色的人。</p>
                <p class="quote-author">—— 吉尔伯特</p>
            </div>

            <div class="quote-card">
                <p class="quote-text">爱情是自由自在的，而自由自在的爱情是最真切的。</p>
                <p class="quote-author">—— 丁尼生</p>
            </div>

            <div class="quote-card">
                <p class="quote-text">真正的爱情，应该是两个人，彼此理解，互相尊重，不缠绕，不牵绊，不占有，然后相伴，走过一段漫长的旅程。</p>
                <p class="quote-author">—— 扎西拉姆·多多</p>
            </div>

            <div class="quote-card">
                <p class="quote-text">爱情不是寻找共同点，而是学会尊重不同点。</p>
                <p class="quote-author">—— 彼得·德鲁克</p>
            </div>

            <div class="quote-card">
                <p class="quote-text">对于爱情，年是什么？既是分钟，又是世纪。说它是分钟是因为在爱情的甜蜜之中，它像闪电一般瞬息即逝；说它是世纪，是因为它在我们身上建筑生命之后的幸福的永生。</p>
                <p class="quote-author">—— 雨果</p>
            </div>

            <div class="quote-card">
                <p class="quote-text">爱情需要合理的内容，正像熊熊烈火要油来维持一样；爱情是两个相似的天性在无限感觉中的和谐的交融。</p>
                <p class="quote-author">—— 别林斯基</p>
            </div>

            <div class="quote-card">
                <p class="quote-text">爱情是发生在两个人之间的一种共同的经验。</p>
                <p class="quote-author">—— 卡伦·霍妮</p>
            </div>

            <div class="quote-card">
                <p class="quote-text">最甜美的是爱情，最苦涩的也是爱情。</p>
                <p class="quote-author">—— 菲·贝利</p>
            </div>

            <div class="quote-card">
                <p class="quote-text">爱情是理解和体贴的别名。</p>
                <p class="quote-author">—— 泰戈尔</p>
            </div>

            <div class="quote-card">
                <p class="quote-text">爱情里面要是搀杂了和它本身无关的算计，那就不是真的爱情。</p>
                <p class="quote-author">—— 莎士比亚</p>
            </div>

            <div class="quote-card">
                <p class="quote-text">爱情是一位伟大的导师，教我们重新做人。</p>
                <p class="quote-author">—— 莫里哀</p>
            </div>

            <div style="height: 1px; background: linear-gradient(to right, transparent, #e66465, transparent); margin: 40px 0;"></div>

            <div style="text-align: center; padding: 20px; background-color: #f8f9fc; border-radius: 12px;">
                <p style="font-size: 18px; color: #555; line-height: 1.6;">"爱情是心灵的碰撞，是灵魂的共鸣，是生命中最美的诗篇。"</p>
                <p style="font-size: 14px; color: #888; margin-top: 15px;">愿这些句子能触动你心底最柔软的角落，感受到爱情的美好与力量。</p>
            </div>
        </div>
    </div>

    <script>
        const fontSizes = {
            pageTitle: 28,
            quoteText: 17,
            quoteAuthor: 14,
            sectionTitle: 22,
            highlightedQuote: 20,
            highlightedSubtitle: 16,
            finalQuote: 18,
            finalSubtitle: 14
        };
        
        const fontSizeRanges = {
            pageTitle: { min: 22, max: 72 },
            quoteText: { min: 14, max: 48 },
            quoteAuthor: { min: 12, max: 40 },
            sectionTitle: { min: 18, max: 56 },
            highlightedQuote: { min: 16, max: 52 },
            highlightedSubtitle: { min: 14, max: 44 },
            finalQuote: { min: 15, max: 50 },
            finalSubtitle: { min: 12, max: 40 }
        };
        
        const contentContainer = document.getElementById('content-container');

        document.getElementById('font-enlarge').addEventListener('click', function() {
            const canEnlarge = Object.entries(fontSizes).some(([key, size]) => {
                return size < fontSizeRanges[key].max;
            });
            
            if (canEnlarge) {
                Object.entries(fontSizes).forEach(([key, size]) => {
                    if (size < fontSizeRanges[key].max) {
                        fontSizes[key] = size + 1;
                    }
                });
                updateFontSizes();
            }
        });

        document.getElementById('font-reduce').addEventListener('click', function() {
            const canReduce = Object.entries(fontSizes).some(([key, size]) => {
                return size > fontSizeRanges[key].min;
            });
            
            if (canReduce) {
                Object.entries(fontSizes).forEach(([key, size]) => {
                    if (size > fontSizeRanges[key].min) {
                        fontSizes[key] = size - 1;
                    }
                });
                updateFontSizes();
            }
        });

        function updateFontSizes() {
            const pageTitle = document.querySelector('#content-container > div > div:nth-child(2)');
            if (pageTitle) {
                pageTitle.style.fontSize = `${fontSizes.pageTitle}px`;
            }
            
            document.querySelectorAll('.quote-text').forEach(el => {
                el.style.fontSize = `${fontSizes.quoteText}px`;
            });
            
            document.querySelectorAll('.quote-author').forEach(el => {
                el.style.fontSize = `${fontSizes.quoteAuthor}px`;
            });
            
            document.querySelectorAll('.section-title').forEach(el => {
                el.style.fontSize = `${fontSizes.sectionTitle}px`;
            });
            
            const highlightedSection = document.querySelector('#content-container > div > div:nth-child(3)');
            if (highlightedSection) {
                const quote = highlightedSection.querySelector('p:first-child');
                const subtitle = highlightedSection.querySelector('p:last-child');
                if (quote) quote.style.fontSize = `${fontSizes.highlightedQuote}px`;
                if (subtitle) subtitle.style.fontSize = `${fontSizes.highlightedSubtitle}px`;
            }
            
            const finalSection = document.querySelector('#content-container > div > div:last-child');
            if (finalSection) {
                const quote = finalSection.querySelector('p:first-child');
                const subtitle = finalSection.querySelector('p:last-child');
                if (quote) quote.style.fontSize = `${fontSizes.finalQuote}px`;
                if (subtitle) subtitle.style.fontSize = `${fontSizes.finalSubtitle}px`;
            }
        }

        document.getElementById('export-image').addEventListener('click', function() {
            this.innerHTML = '<i class="fas fa-spinner fa-spin"></i>';
            this.disabled = true;

            html2canvas(contentContainer, {
                scale: 2, 
                useCORS: true, 
                logging: false,
                backgroundColor: null
            }).then(canvas => {
                const link = document.createElement('a');
                link.download = "美入心间的爱情名言与句子.png";
                link.href = canvas.toDataURL('image/png');
                link.click();

                this.innerHTML = '<i class="fas fa-file-export"></i>';
                this.disabled = false;
            }).catch(err => {
                console.error('导出失败：', err);
                alert('长图导出失败，请重试！');
                this.innerHTML = '<i class="fas fa-file-export"></i>';
                this.disabled = false;
            });
        });
    </script>

</body>
</html>